#!/usr/bin/env python

from google.appengine.ext import db

class Dummy(db.Model):
	text=db.StringProperty()

class Profile(db.Model):
	name=db.StringProperty(required=True)
	email=db.EmailProperty(required=True)
	gender=db.StringProperty(required=False,choices=set(["Homem","Mulher","Outro"])) #1-Male/2-Female/3-Other
	phone_number=db.PhoneNumberProperty(required=False) # Just for novinhas

class Place(db.Model): # Like Rua da Moeda, Arsenal, Pitombeira
	name=db.StringProperty(required=True)
	geolocalization=db.GeoPtProperty(required=True)

class Event(db.Model):
	name=db.StringProperty(required=True)
	date=db.DateProperty(required=True)
	time=db.StringProperty(required=True) #Format 24h 
	place=db.ReferenceProperty(Place)
	likes=db.IntegerProperty(default=0) 


#class Schedule(db.Model):
#	owner=Profile()

# This is a schedule	
class Item(db.Model): #Schedule's Items
#	schedule=Schedule() 
	profile=db.ReferenceProperty(Profile)
	event=db.ReferenceProperty(Event)
	
class UserComment(db.Model): # like scrap
	profile=db.ReferenceProperty(Profile,collection_name='profile')
	sender=db.ReferenceProperty(Profile,collection_name='sender')
	text=db.StringProperty(required=True,multiline=True) #500 chars 

class EventComment(db.Model): #About the event
	event=db.ReferenceProperty(Event)
	text=db.StringProperty(required=True,multiline=True)
